package com.smartdo.crawler.utils;

import java.util.Properties;

/**
 * Created by fate.
 */
public class PropertiesUtil {

    private static Properties props = new Properties();

    static {
        try {
            props.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("config.properties"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static String getMyPropertie(String filename, String pramName) {
        Properties props = new Properties();
        try {
            props.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(filename));
        } catch (Exception ex) {
            System.out.println(String.format("加载配置文件$s出错", filename));
        }
        return props.getProperty(pramName);
    }

    public static String getPropertie(String name) {
        return props.getProperty(name);
    }
}
